<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // charAt和charCodeAt对比
    // charAt返回指定位置的字符,charCodeAt返回指定位置的字符ASCll码
    let str = 'Hello world!'
    console.log('charAt', str.charAt(0))
    console.log('charCodeAt', str.charCodeAt(0))
  </script>

</body>

</html>